#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < b; ++i)
int n;
const int N = 60;
int a[N], cnt[110];
using namespace std;
int main() {
  int tc;
  cin >> tc;
  while (tc--) {
    cin >> n;
    memset(cnt, 0, sizeof cnt);
    rep(i, 0, n) cin >> a[i];
    rep(i, 0, n) { cnt[a[i]]++; }
    int seg = 0;
    int i = 1;
    while (i <= 100) {
      while (i <= 100 && !cnt[i]) i++;
      if (i <= 100) seg++;
      while (i <= 100 && cnt[i]) {
        i++;
      }
    }
    cout << (seg == 1 ? "YES\n" : "NO\n");
  }
}
